<?php

class Notes extends Model {

    function Notes()
    {
        parent::Model();
    }

    function add()
    {
        $this->load->helper('form');
        $data = array(
        'author'=>$this->input->xss_clean($this->input->post('author')),
        'title'=>$this->input->xss_clean($this->input->post('title')),
        'address'=>$this->input->xss_clean($this->input->post('address')),
        'content'=>$this->input->xss_clean($this->input->post('content')),
        'process'=>$this->input->xss_clean($this->input->post('process')),
        );

        $this->db->insert('note',$data);
    }

    function edit()
    {
        $this->load->helper('form');
        $data = array(
        'author'=>$this->input->xss_clean($this->input->post('author')),
        'title'=>$this->input->xss_clean($this->input->post('title')),
        'address'=>$this->input->xss_clean($this->input->post('address')),
        'content'=>$this->input->xss_clean($this->input->post('content')),
        'process'=>$this->input->xss_clean($this->input->post('process')),
        );

        $this->db->where('id',$this->input->post('id'));
        $this->db->update('note',$data);
    }
    
    function delete()
    {
        echo "hello";
    }
}